package practice1_100;

import java.util.LinkedList;
import java.util.Queue;

public class Practice55 {
    public boolean canJump(int[] nums) {
        int target=nums.length;
        boolean[] res=new boolean[nums.length];
        if(nums[0]!=0){res[0]=true;}
        else return false;
        for(int i=1;i<res.length;i++){
            for(int j=i-1;j>=0;j--){
                if(res[i]==true)break;
                if(nums[j]>=i-j&&res[j]==true)res[i]=res[i]||true;
            }
        }
        return res[nums.length-1];
    }

    public static void main(String[] args) {
     boolean res=   new Practice55().canJump(new int[]{1,0,1,0});
    Queue<int[][]> queue=new LinkedList<>();

    }
}
